﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YBApproval.IDAL;

namespace YBApproval.EFDAL
{
    public class FormDAL : IForm
    {
        private YBDbContext db = new YBDbContext();

        public int GetProcessId(int formId)
        {
            int iResult = 0;
            var processid = from f in db.Form_ProcessSets
                         where f.FormId == formId
                         select f.ProcessId;
            if (processid != null && processid.Count() > 0)
            {
                iResult = processid.First();
            }
            return iResult;
        }

        public void Dispose()
        {
            db.Dispose();
        }
    }
}
